package com.ndp.fb.walle.business;


import com.ndp.fb.rdb.model.EntrustAccount;
import com.ndp.fb.rdb.model.EntrustAccountExt;
import com.ndp.fb.rdb.model.Pager;
import com.ndp.fb.rdb.model.User;
import com.ndp.fb.walle.model.bo.entrustaccount.AccountOperateHistoryResult;

import java.util.List;

/**
 * Created by Mikey.zhaopeng on 2014/10/22 20:44.
 * Email mikey.zhao@ndpmedia.com
 */
public interface EntrustAccountService {
    /**
     * @param fbConnectionObjectId
     * @return
     */
    List<EntrustAccountExt> findEntrustAccountsByfbConnectionObjectIdAndUserId(Long fbConnectionObjectId, String userId);

    boolean saveOrUpdateEntrust(List<EntrustAccount> recycleEntrustAccounts, List<EntrustAccount> newAddEntrustAccounts, String userId, List<Long> ids);

    String getTokenByFbAccountId(Long accountId);

    Pager<EntrustAccountExt> findEntrustAccountsPagerByUserId(String userId, Long businessId, Integer offset, Integer limit);

    List<EntrustAccountExt> findEntrustAccountsByUserId(String userId);


    List<EntrustAccountExt> findEntrustAccountsByUserId(String userId, Long businessId);

    /**
     * 得到账号操作历史行为
     *
     * @param user 操作用户
     * @return
     */
    List<AccountOperateHistoryResult> getAccountOperateHistoryList(User user);

    /**
     * 解除绑定账号
     *
     * @param fb_account_id facebook广告账号
     * @param user          操作用户
     * @return
     */
    Boolean unBindEntrustAccount(Long fb_account_id, Long fb_bussines_id, User user);

    List<EntrustAccountExt> findEntrustAccountsByUserIdAndConnObjId(String ticket, Long connObjId);
}
